<template>
	<view class="container">
		<map class="myMap" :longitude="lon" :latitude="lat"></map>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lon: '',
				lat: '',
			}
		},
		onLoad() {
			let that = this
			uni.getLocation({
				type: 'gcj02',
				success: function(res) {
					// console.log(res)
					that.lat = res.latitude
					that.lon = res.longitude
				},
				fail: function() {
					uni.showToast({
						title: "当前位置信息获取失败",
						icon: 'none'
					})
				}
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100vw;
		height: 100vh;

		.myMap {
			width: 100%;
			height: 100%;
		}
	}
</style>